package com.ymttest.database.sqlwapper.godfreight;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.freight_template_detail;
import com.ymttest.utils.EnvSetup;

import java.util.HashMap;
import java.util.List;

public class freight_template_detailWapper {
	SqlManager manager;

    public freight_template_detailWapper() {
        manager = new SqlManager("mysqlgodfreight" + EnvSetup.getEnv());
    }

    public freight_template_detail selectDefaultByTemplateIdAndSaleMode(int templateId,int saleMode) {
    	HashMap map=new HashMap();
    	map.put("templateId", templateId);
    	map.put("saleMode", saleMode);
    	freight_template_detail model=new freight_template_detail();
        List<freight_template_detail> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.godfreight.freight_template_detailMapper.selectDefaultByTemplateIdAndSaleMode",
                        map);
        manager.commit();
        if(result.size()>0)
        {
        	model=result.get(0);
        }
        return model;
    }

    public List<freight_template_detail> selectByTemplateId(int templateId) {
        List<freight_template_detail> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.godfreight.freight_template_detailMapper.selectByTemplateId",
                        templateId);
        manager.commit();
        return result;
    }
    
 
    
    

    public static void main(String[] args) {
        freight_template_detailWapper freight_template_detailWapper = new freight_template_detailWapper();
        System.out.println(freight_template_detailWapper.selectByTemplateId(1));
    }
}
